package com.eastchina.fids2focs.dao;

import java.util.List;

import org.springframework.beans.factory.annotation.Autowired;

import com.eastchina.fids2focs.domain.SystemRole;
import com.eastchina.fw.database.dao.QueryDAO;

public class SystemRoleDAOImpl implements SystemRoleDAO {

	/**
	 * Query DAO instance
	 */
	@Autowired
	QueryDAO queryDAO;
	
	/**
	 * 取得全部角色基本信息
	 */
	public List<SystemRole> getAllRoles() {
		return getAllRoles(false);
	}
	
	/**
	 * 取得全部角色基本信息
	 */	
	public List<SystemRole> getAllRoles(boolean cascade) {
		if (!cascade) {
			return queryDAO.executeForObjectList("SYSTEM_ROLE.selectAllRoles", QueryDAO.EMPTY_PARAMS);
		} else {
			// Select All Role
			return queryDAO.executeForObjectList("SYSTEM_ROLE.selectAllRolesCascade", QueryDAO.EMPTY_PARAMS);
		}	
	}
}
